home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / Demos / Mac / Matthew's Behaviors / KeyboardEventƒ / NumberKeys < prev   
Encoding:
INI File  |  2001-09-10  |  1.1 KB  |  48 lines

  1. [Name]
  2. NumberKeys - Use with keyboardEvent to poll numbers
  3. By Matthew Peterson, matthew@pinoko.berkeley.edu
  4.  
  5. [Description]
  6. 2-19-2000
  7. Place this behavior in the same sprite as the KeyboardEvent
  8. behavior to have  the following numbers and symbols polled:
  9. 0123456789:.-,
  10.  
  11. [Parameters]
  12.  
  13. [200072 MP_KBNumeric]
  14. GlobalVars whichkeyN whichkeyC IsCap
  15. //Use with KeyboardEvent Behavior.
  16. //Numbers and symbols uses with numbers
  17. //Returns the ascii  of the character.
  18. IF(KeyIsDown(kNone,'0'))
  19.     whichkeyN = 48
  20. ELSEIF(KeyIsDown(kNone,'1'))
  21.     whichkeyN = 49
  22. ELSEIF(KeyIsDown(kNone,'2'))
  23.     whichkeyN = 50
  24. ELSEIF(KeyIsDown(kNone,'3'))
  25.     whichkeyN = 51
  26. ELSEIF(KeyIsDown(kNone,'4'))
  27.     whichkeyN = 52
  28. ELSEIF(KeyIsDown(kNone,'5'))
  29.     whichkeyN = 53
  30. ELSEIF(KeyIsDown(kNone,'6'))
  31.     whichkeyN = 54
  32. ELSEIF(KeyIsDown(kNone,'7'))
  33.     whichkeyN = 55
  34. ELSEIF(KeyIsDown(kNone,'8'))
  35.     whichkeyN = 56
  36. ELSEIF(KeyIsDown(kNone,'9'))
  37.     whichkeyN = 57
  38. ELSEIF(KeyIsDown(kShiftKey,';'))
  39.     whichkeyN = 58
  40. ELSEIF(KeyIsDown(kNone,'-'))
  41.     whichkeyN = 45
  42. ELSEIF(KeyIsDown(kNone,','))
  43.     whichkeyN = 44
  44. ELSEIF(KeyIsDown(kNone,'.'))
  45.     whichkeyN = 46
  46. ENDIF
  47.  
  48.